package com.sayice.design.lab7_2;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author shubing
 */
public abstract class AbstractDataCategory {
    protected List<String> data = new ArrayList<>();
    protected List<List<String>> dataGroup = new ArrayList<>();
    
    public void classifyData() {
        read();
        format();
        classify();
        show();
    }
    
    public void read() {
        data.addAll(Arrays.asList(" h ", " h ", " hh ", " hh ", " hhh ", " hhh "));
    }
    
    public void format() {
        for (int i = 0; i < data.size(); i++) {
            data.set(i, data.get(i).trim());
        }
    }
    
    public abstract void classify();
    
    public void show() {
        System.out.println(dataGroup);
    }
}
